package com.maschinenstuermer.profiler.model.impl;


import javax.xml.bind.annotation.XmlElement;

public abstract class Invocation {
	@XmlElement
	private Metrics metrics = new Metrics();

	public abstract void accept(ModelVisitor visitor);
	
	public Metrics getMetrics() {
		return metrics;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((metrics == null) ? 0 : metrics.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Invocation other = (Invocation) obj;
		if (metrics == null) {
			if (other.metrics != null)
				return false;
		} else if (!metrics.equals(other.metrics))
			return false;
		return true;
	}
}
